﻿using DimensionsHelper.Common.CsvFormatter;
using DimensionsHelper.Common.DataCollector;
using DimensionsHelper.Common.Excel;
using DimensionsHelper.Common.Metadata;
using DimensionsHelper.Common.SQL;
using DimensionsHelper.Common.Table;
using DimensionsHelper.Services.CsvFormatter;
using DimensionsHelper.Services.CsvReader;
using DimensionsHelper.Services.DataCollector;
using DimensionsHelper.Services.Excel.EPPlus;
using DimensionsHelper.Services.Metadata;
using DimensionsHelper.Services.SQL;
using Microsoft.Extensions.DependencyInjection;

namespace UnitTest;

public static class TestServices
{

    private static readonly IServiceCollection services = new ServiceCollection();


    static TestServices()
    {
        services.AddTransient<IMetadataDocument, MetadataDocument>();
        services.AddTransient<IExcelWorkbookOperator, ExcelWorkbookOperator>();
        services.AddTransient<ITextReader, CsvStreamReader>();
        services.AddTransient<ICsvFormatter, CsvFormatter>();
        services.AddTransient<ICollector, ExcelDataCollector>();
        services.AddKeyedTransient<ISqlBuilder, InsertSqlBuilder>("InsertSqlBuilder");
        services.AddKeyedTransient<ISqlBuilder, UpdateSqlBuilder>("UpdateSqlBuilder");
    }


    public static ServiceProvider Provider => services.BuildServiceProvider();

}
